﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XBD.MsgServicePro
{
    public class OrderProcessor
    {

        private readonly List<INotification>messageServices;

        public OrderProcessor() 
        {
            messageServices = new List<INotification>();
        }

        //注册服务
        public void RegisterNotification(INotification notification) 
        {
            messageServices.Add(notification);
        }

        public void Process() 
        {
            //处理订单....发货....
            //通知用户收货
            foreach (INotification n in messageServices) 
            {
                n.send("订单已发货");
            }

        }

    }
}
